//
//  ZOEPickerView.h
//  1.支持多列选择
//  2.默认选中每列的中间值
//  3.定制时，直接为pickerView的设置代理，即可覆盖
//
//  Created by 徐秀滨 on 2018/3/16.
//  Copyright © 2018年 Xiamen Zoenet Tech Co.,Ltd. All rights reserved.
//

#import <UIKit/UIKit.h>

@class ZOEPickerView;

@protocol ZOEPickerViewDelegate <NSObject>

- (void)zoePickerView:(ZOEPickerView*)pickerView confirmWithIndexes:(NSMutableArray*)indexArray titles:(NSMutableArray*)titleArray;

@end

@interface ZOEPickerView : UIView

@property (nonatomic, strong) UIPickerView *pickerView;
@property (nonatomic, weak) id<ZOEPickerViewDelegate> delegate;

/**
 *注意：默认数据集用
 */
@property (nonatomic, strong) NSMutableArray *selectedIndexes;
@property (nonatomic, assign) NSInteger selectedIndex;
@property (nonatomic, copy) NSString *key;

/**
 多列

 @param dataSource 数组嵌套数组
 @param selectedIndexes 数组里面是选中的索引。默认请传<0的任意值，取中间索引
 @return return value description
 */
- (instancetype)initWithDataSource:(NSMutableArray*)dataSource selectedIndexes:(NSMutableArray*)selectedIndexes;

/**
 单列

 @param dataSource dataSource description
 @param selectedIndex selectedIndex description。默认请传<0的任意值，取中间索引
 @return return value description
 */
- (instancetype)initWithDataSource:(NSMutableArray*)dataSource selectedIndex:(NSInteger)selectedIndex;

/**
 （多列）重新设置数据源和选中

 @param dataSource dataSource description
 @param selectedIndex selectedIndex description。默认请传<0的任意值，取中间索引
 */
- (void)resetDataSource:(NSMutableArray*)dataSource selectedIndex:(NSInteger)selectedIndex;

/**
 （单列）重新设置数据源和选中

 @param dataSource dataSource description
 @param selectedIndexes selectedIndexes description。默认请传<0的任意值，取中间索引
 */
- (void)resetDataSource:(NSMutableArray*)dataSource selectedIndexes:(NSMutableArray*)selectedIndexes;

- (void)show;

- (void)hide;

@end
